<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="mfuny.ggongal.admin.json.JsonCreater" %>
<%@ page import="java.util.*" %>
<%@ page import="org.json.simple.*" %>
<%@ page import="mfuny.ggongal.admin.http.HttpEvent" %>
<%@ page import="mfuny.ggongal.admin.debug.Debug" %>
<%@ page trimDirectiveWhitespaces="true" %>
<%
request.setCharacterEncoding( "utf-8" );
response.setContentType( "text/html; charset=utf-8" );

JsonCreater jc = new JsonCreater();
HttpEvent event = new HttpEvent();

String tag = request.getParameter("tag");

//이벤트 베너 리스트 가져오기.
if( tag.equals("event_getEventToday") ) {
	JSONObject json = null;
	try {
		json = event.event_getEventToday();
		out.print(json.toJSONString());
	} catch(Exception e) {
		Debug.toDebugFile(e, tag);
		json = new JSONObject();
		json.put("responseCode", -1);
		out.print(json.toJSONString());
	}
}

//이벤트 번호로 본문 내용 가져오기.
else if( tag.equals("event_getContentByNo")) {
	try {
		int ev_no = Integer.parseInt(request.getParameter("ev_no"));
		String content = event.event_getContentByNo(ev_no);
		out.print(
				"<meta name=\"viewPort\" content=\"initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scale=no;\" />\n"
				 + content
			);
	} catch ( Exception e ) {
		Debug.toDebugFile(e, tag);
	}
}
%>